﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeTorus : OdGeSurface
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeTorus(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeTorus_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeTorus obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeTorus()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeTorus(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeTorus() : this(GlobalsPINVOKE.new_OdGeTorus__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeTorus(double majorRadius, double minorRadius, OdGePoint3d center, OdGeVector3d axisOfSymmetry) : this(GlobalsPINVOKE.new_OdGeTorus__SWIG_1(majorRadius, minorRadius, OdGePoint3d.getCPtr(center), OdGeVector3d.getCPtr(axisOfSymmetry)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeTorus(double majorRadius, double minorRadius, OdGePoint3d center, OdGeVector3d axisOfSymmetry, OdGeVector3d refAxis, double startAngleU, double endAngleU, double startAngleV, double endAngleV) : this(GlobalsPINVOKE.new_OdGeTorus__SWIG_2(majorRadius, minorRadius, OdGePoint3d.getCPtr(center), OdGeVector3d.getCPtr(axisOfSymmetry), OdGeVector3d.getCPtr(refAxis), startAngleU, endAngleU, startAngleV, endAngleV), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeTorus(OdGeTorus source) : this(GlobalsPINVOKE.new_OdGeTorus__SWIG_3(OdGeTorus.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double majorRadius()
		{
			double result = GlobalsPINVOKE.OdGeTorus_majorRadius(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double minorRadius()
		{
			double result = GlobalsPINVOKE.OdGeTorus_minorRadius(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getAnglesInU(out double startAngleU, out double endAngleU)
		{
			GlobalsPINVOKE.OdGeTorus_getAnglesInU(this.swigCPtr, out startAngleU, out endAngleU);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getAnglesInV(out double startAngleV, out double endAngleV)
		{
			GlobalsPINVOKE.OdGeTorus_getAnglesInV(this.swigCPtr, out startAngleV, out endAngleV);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGePoint3d center()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeTorus_center(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector3d axisOfSymmetry()
		{
			OdGeVector3d result = new OdGeVector3d(GlobalsPINVOKE.OdGeTorus_axisOfSymmetry(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector3d refAxis()
		{
			OdGeVector3d result = new OdGeVector3d(GlobalsPINVOKE.OdGeTorus_refAxis(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isOuterNormal()
		{
			bool result = GlobalsPINVOKE.OdGeTorus_isOuterNormal(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeTorus setMajorRadius(double radius)
		{
			OdGeTorus result = new OdGeTorus(GlobalsPINVOKE.OdGeTorus_setMajorRadius(this.swigCPtr, radius), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeTorus setMinorRadius(double radius)
		{
			OdGeTorus result = new OdGeTorus(GlobalsPINVOKE.OdGeTorus_setMinorRadius(this.swigCPtr, radius), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeTorus setAnglesInU(double startAngleU, double endAngleU)
		{
			OdGeTorus result = new OdGeTorus(GlobalsPINVOKE.OdGeTorus_setAnglesInU(this.swigCPtr, startAngleU, endAngleU), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeTorus setAnglesInV(double startAngleV, double endAngleV)
		{
			OdGeTorus result = new OdGeTorus(GlobalsPINVOKE.OdGeTorus_setAnglesInV(this.swigCPtr, startAngleV, endAngleV), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeTorus set(double majorRadius, double minorRadius, OdGePoint3d center, OdGeVector3d axisOfSymmetry)
		{
			OdGeTorus result = new OdGeTorus(GlobalsPINVOKE.OdGeTorus_set__SWIG_0(this.swigCPtr, majorRadius, minorRadius, OdGePoint3d.getCPtr(center), OdGeVector3d.getCPtr(axisOfSymmetry)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeTorus set(double majorRadius, double minorRadius, OdGePoint3d center, OdGeVector3d axisOfSymmetry, OdGeVector3d refAxis, double startAngleU, double endAngleU, double startAngleV, double endAngleV)
		{
			OdGeTorus result = new OdGeTorus(GlobalsPINVOKE.OdGeTorus_set__SWIG_1(this.swigCPtr, majorRadius, minorRadius, OdGePoint3d.getCPtr(center), OdGeVector3d.getCPtr(axisOfSymmetry), OdGeVector3d.getCPtr(refAxis), startAngleU, endAngleU, startAngleV, endAngleV), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeTorus Assign(OdGeTorus torus)
		{
			OdGeTorus result = new OdGeTorus(GlobalsPINVOKE.OdGeTorus_Assign(this.swigCPtr, OdGeTorus.getCPtr(torus)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGeLinearEnt3d linEnt, out int numInt, OdGePoint3d p1, OdGePoint3d p2, OdGePoint3d p3, OdGePoint3d p4, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeTorus_intersectWith__SWIG_0(this.swigCPtr, OdGeLinearEnt3d.getCPtr(linEnt), out numInt, OdGePoint3d.getCPtr(p1), OdGePoint3d.getCPtr(p2), OdGePoint3d.getCPtr(p3), OdGePoint3d.getCPtr(p4), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGeLinearEnt3d linEnt, out int numInt, OdGePoint3d p1, OdGePoint3d p2, OdGePoint3d p3, OdGePoint3d p4)
		{
			bool result = GlobalsPINVOKE.OdGeTorus_intersectWith__SWIG_1(this.swigCPtr, OdGeLinearEnt3d.getCPtr(linEnt), out numInt, OdGePoint3d.getCPtr(p1), OdGePoint3d.getCPtr(p2), OdGePoint3d.getCPtr(p3), OdGePoint3d.getCPtr(p4));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isLemon()
		{
			bool result = GlobalsPINVOKE.OdGeTorus_isLemon(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isApple()
		{
			bool result = GlobalsPINVOKE.OdGeTorus_isApple(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isVortex()
		{
			bool result = GlobalsPINVOKE.OdGeTorus_isVortex(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isDoughnut()
		{
			bool result = GlobalsPINVOKE.OdGeTorus_isDoughnut(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isDegenerate()
		{
			bool result = GlobalsPINVOKE.OdGeTorus_isDegenerate(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isHollow()
		{
			bool result = GlobalsPINVOKE.OdGeTorus_isHollow(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
